package com.yonyou.hxjy.service.dingtalk;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.yonyou.hxjy.entity.ProcessInstance;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

public interface DingtalkProcessInstanceToYs {

        //汇率类型
        static final String EXCHANGE_RATE_TYPE_CODE = "01";
        //交易类型
        static final String [] TRADE_TYPE_CODE = {"cmp_fund_payment_reimburse","cmp_fund_payment_purchase","cmp_fund_payment_other","cmp_fundcollection_other"};
        //款项类型
        static final String [] QUICK_TYPE_CODE = {"3","5","9","12","13","14","22"}; //{费用,预付款,资金调拨,付押金,借款,备用金,收押金}
        //结算方式
        static final String [] SETTLEMODE_CODE = {"system_0001","system_0004"}; //{银行转账,支付宝2}
        //需要获取税额的付款主体
        static final List<String> ORG_NAME = new ArrayList<String>(Arrays.asList("四川梦烛网络科技有限公司","四川盈播网络科技有限公司", "成都河许网络科技有限公司", "四川短歌网络科技有限公司", "四川盼之网络科技有限公司", "四川最玩家网络科技有限公司","四川人间梦华网络科技有限公司"));

        //汇率
        static final double EXCH_RAGE = 1.0;
        //付款币种
        static final String CURRENCY_CODE = "CNY";

        //费用报销资金收款单保存到Ys中
        public List<JSONObject> expenseClaim_toYsJson(List<JSONObject> jsonObjectList,List<String> processInstanceIdList);

        //费用报销新单据收款单保存到Ys中
        public List<JSONObject> newExpenseClaim_toYsJson(List<JSONObject> jsonObjectList);

//        public List<JSONObject> expenseClaim_toYsJsonNew(List<JSONObject> jsonObjectList);

        //预付款资金收款单保存到Ys中
        public List<JSONObject> advancePayment_toYsJson(List<JSONObject> jsonObjectList);

        public List<JSONObject> newadvancePayment_toYsJson(List<JSONObject> jsonObjectList);

        //资金调拨收款单保存到Ys中
        public List<JSONObject> fundAllocation_toYsJson(List<JSONObject> jsonObjectList);

        //时间格式转换
        public String dateFormChange(String isoDateTime );

        //获取银行账户编码
        public String getBankCode(String org_name,List<JSONObject> bankList);

        //获取供应商编码
        public String getVendorCode(String vendor_name,Map<String,Object> bankParamMap,List<JSONObject> vendorList);

        //发送ys请求保存付款单
        public JSONObject sendPostToSaveFundPayment(Map<String,Object> paramMap) throws Exception;

        //发送ys请求保存收款单
        public JSONObject sendPostToSaveFundCollection(Map<String,Object> paramMap) throws Exception;

        public JSONObject sendPostToSubmit(Map<String,Object> paramMap) throws Exception;

        //xxl-job日志记录
        public void InsertLogger(String code, String oneL, String mags,String jobClass);

        //通过审核人过滤数据
//        public List<JSONObject> filter_Reviewer(List<JSONObject> jsonObjectList);

        //处理响应结果
        public void processResponseResults(JSONObject jsonObjectResponse, String businessId, String saveType, ProcessInstance processInstance);

        //获取审批实例对象
        public ProcessInstance getProcessInstance(JSONArray jsonArray);
}
